package com.qiaofang.common.exception;

import com.qiaofang.common.constant.ExceptionEnum;

public class BusinessException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    protected String errorCode;

    public BusinessException(String msg, Throwable t) {
        super(msg, t);
    }

    public BusinessException(String errorCode, String msg) {
        super(msg);
        this.errorCode = errorCode;
    }

    public BusinessException(ExceptionEnum businessExceptionEnum) {
        super(businessExceptionEnum.getMessage());
        this.errorCode = businessExceptionEnum.getCode();
    }

    public BusinessException(String msg) {
        super(msg);
    }

    public String getErrorCode() {
        return this.errorCode;
    }

}
